package com.soft863.tc.producer;

import com.soft863.tc.common.bean.Producer;
import com.soft863.tc.producer.bean.LocalFileProducer;
import com.soft863.tc.producer.io.LocalFileDataIn;
import com.soft863.tc.producer.io.LocalFileDataOut;

import java.io.IOException;

/*
 * 启动对象
 * */
public class Bootstrap {
    public static void main(String[] args) throws IOException {
        if (args.length < 2) {
            System.out.println("系统参数不正确，请按照指定格式传递：java -jar Jar path1 path2");
            System.exit(1);
        }
        //构建生产者对象
        Producer producer = new LocalFileProducer();

        producer.setIn(new LocalFileDataIn(args[0]));
        producer.setOut(new LocalFileDataOut(args[1]));
        //生产数据
        producer.producer();
        //关闭生产者
        producer.close();
    }
}
